/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import java.util.ArrayList;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import java.util.concurrent.ConcurrentHashMap;
/*     */ import net.minecraft.client.Minecraft;
/*     */ import net.minecraft.client.entity.EntityPlayerSP;
/*     */ import net.minecraft.client.gui.GuiScreen;
/*     */ import net.minecraft.entity.player.EntityPlayer;
/*     */ import net.minecraft.inventory.Container;
/*     */ import net.minecraft.inventory.Slot;
/*     */ import net.minecraft.item.ItemStack;
/*     */ import org.yaml.snakeyamla.configuration.file.YamlConfiguration;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class dh
/*     */ {
/*  26 */   public static final dh d = new dh();
/*     */ 
/*     */   
/*  29 */   private final ConcurrentHashMap<String, ItemStack> z = new ConcurrentHashMap<>();
/*  30 */   private final ConcurrentHashMap<String, YamlConfiguration> i = new ConcurrentHashMap<>();
/*  31 */   private final ConcurrentHashMap<String, String> w = new ConcurrentHashMap<>();
/*  32 */   private final ConcurrentHashMap<String, vh> q = new ConcurrentHashMap<>();
/*  33 */   private Minecraft g = Minecraft.func_71410_x();
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public void h() {
/*  41 */     this.z.clear();
/*  42 */     this.i.clear();
/*     */   }
/*     */   
/*     */   public boolean v(String str) {
/*  46 */     return false;
/*     */   }
/*     */   
/*     */   public vh h(String str) {
/*  50 */     if (!this.i.containsKey(str)) {
/*  51 */       return null;
/*     */     }
/*     */ 
/*     */     
/*  55 */     vh vh = new vh(str, this.i.get(str), this.i, this.g.field_71439_g.field_71069_bz, vh.eos/moe/dragoncore/ng.z);
/*     */ 
/*     */     
/*  58 */     vh.open();
/*  59 */     Minecraft.func_71410_x().func_147108_a((GuiScreen)vh);
/*  60 */     return vh;
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   public void z(String str) {}
/*     */ 
/*     */ 
/*     */   
/*     */   public void z() {}
/*     */ 
/*     */ 
/*     */   
/*     */   public void v(String str) {}
/*     */ 
/*     */ 
/*     */   
/*     */   public void v() {}
/*     */ 
/*     */   
/*     */   public List<vh> v() {
/*  81 */     ArrayList<vh> arrayList = new ArrayList();
/*  82 */     GuiScreen guiScreen = (Minecraft.func_71410_x()).field_71462_r;
/*  83 */     if (guiScreen instanceof vh) {
/*  84 */       arrayList.add((vh)guiScreen);
/*     */     }
/*  86 */     if (dha.t.q != null) {
/*  87 */       arrayList.add(dha.t.q);
/*     */     }
/*  89 */     arrayList.addAll(pl.i.values());
/*     */     
/*  91 */     return arrayList;
/*     */   }
/*     */   
/*     */   public void v(String str, o... arrayOfO) {
/*  95 */     for (vh vh : v()) {
/*  96 */       kk.z(vh, str, arrayOfO);
/*     */     }
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public vh z(String str) {
/* 105 */     if (!this.i.containsKey(str)) {
/* 106 */       return null;
/*     */     }
/*     */     
/* 109 */     return new vh(str, this.i
/* 110 */         .get(str), this.i, this.g.field_71439_g.field_71069_bz, vh.eos/moe/dragoncore/ng.z);
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public vh v(String str) {
/* 119 */     return null;
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public void v(String str, boolean bool) {
/* 126 */     if (bool) {
/* 127 */       this.z.entrySet().removeIf(entry -> ((String)entry.getKey()).startsWith(a));
/*     */     } else {
/* 129 */       this.z.remove(str);
/*     */     } 
/*     */   }
/*     */   
/*     */   public void v(String str, ItemStack itemStack) {
/* 134 */     this.z.put(str, itemStack);
/*     */   }
/*     */   
/*     */   public fj<ItemStack, String> v(String str, boolean bool) {
/* 138 */     if (str.startsWith("player_")) {
/* 139 */       return fj.v(v(str.substring(7)), null);
/*     */     }
/* 141 */     if (str.startsWith("container_")) {
/* 142 */       Slot slot = v(str.substring(10), bool ? this.g.field_71439_g.field_71069_bz : this.g.field_71439_g.field_71070_bA);
/*     */       
/* 144 */       if (slot == null) {
/* 145 */         return fj.v(ItemStack.field_190927_a, null);
/*     */       }
/* 147 */       if (this.g.field_71462_r instanceof bk && !bool) {
/* 148 */         return ((bk)this.g.field_71462_r).getSlotItemStack(slot);
/*     */       }
/* 150 */       return fj.v(slot.func_75211_c(), null);
/*     */     } 
/*     */     
/* 153 */     if (str.startsWith("{") && str.endsWith("}")) {
/* 154 */       ItemStack itemStack = this.z.get(str);
/* 155 */       if (itemStack == null) {
/* 156 */         itemStack = eg.v(str).v();
/* 157 */         this.z.put(str, itemStack);
/*     */       } 
/* 159 */       return fj.v(itemStack, null);
/*     */     } 
/*     */     
/* 162 */     if (!this.z.containsKey(str)) {
/* 163 */       uy.v("DragonCore_RetrieveSlot", new String[] { str });
/*     */       
/* 165 */       this.z.put(str, ItemStack.field_190927_a);
/*     */     } 
/* 167 */     return fj.v(this.z.get(str), null);
/*     */   }
/*     */   
/*     */   public Slot v(String str, Container container) {
/* 171 */     EntityPlayerSP entityPlayerSP = this.g.field_71439_g;
/*     */     
/* 173 */     if (str.startsWith("container_")) {
/* 174 */       str = str.substring(10);
/*     */     }
/* 176 */     switch (str.toLowerCase()) {
/*     */       case "craft":
/* 178 */         str = "0";
/*     */         break;
/*     */       case "craft1":
/* 181 */         str = "1";
/*     */         break;
/*     */       case "craft2":
/* 184 */         str = "2";
/*     */         break;
/*     */       case "craft3":
/* 187 */         str = "3";
/*     */         break;
/*     */       case "craft4":
/* 190 */         str = "4";
/*     */         break;
/*     */       
/*     */       case "head":
/* 194 */         str = "5";
/*     */         break;
/*     */       case "chest":
/* 197 */         str = "6";
/*     */         break;
/*     */       case "leg":
/* 200 */         str = "7";
/*     */         break;
/*     */       case "feet":
/* 203 */         str = "8";
/*     */         break;
/*     */       
/*     */       case "mainhand":
/* 207 */         str = String.valueOf(((EntityPlayer)entityPlayerSP).field_71071_by.field_70461_c + 36);
/*     */         break;
/*     */       case "offhand":
/* 210 */         str = "45";
/*     */         break;
/*     */     } 
/* 213 */     int i = -1;
/* 214 */     String[] arrayOfString = str.split(",", 2);
/* 215 */     if (arrayOfString.length == 2) {
/*     */       try {
/* 217 */         i = ((int)Double.parseDouble(arrayOfString[1]) - 1) * 9 + (int)Double.parseDouble(arrayOfString[0]) - 1;
/* 218 */       } catch (NumberFormatException numberFormatException) {}
/*     */     } else {
/*     */ 
/*     */       
/*     */       try {
/* 223 */         i = (int)Double.parseDouble(str);
/* 224 */       } catch (NumberFormatException numberFormatException) {}
/*     */     } 
/*     */ 
/*     */ 
/*     */ 
/*     */     
/* 230 */     if (i < 0) {
/* 231 */       return null;
/*     */     }
/* 233 */     if (container == null) {
/* 234 */       return null;
/*     */     }
/* 236 */     if (container.field_75151_b.size() < i + 1) {
/* 237 */       return null;
/*     */     }
/*     */     
/* 240 */     return container.func_75139_a(i);
/*     */   }
/*     */   
/*     */   public ItemStack v(String str) {
/* 244 */     EntityPlayerSP entityPlayerSP = this.g.field_71439_g;
/* 245 */     Container container = ((EntityPlayer)entityPlayerSP).field_71069_bz;
/*     */     
/* 247 */     switch (str.toLowerCase()) {
/*     */       case "craft":
/* 249 */         return (ItemStack)container.func_75138_a().get(0);
/*     */       case "craft1":
/* 251 */         return (ItemStack)container.func_75138_a().get(1);
/*     */       case "craft2":
/* 253 */         return (ItemStack)container.func_75138_a().get(2);
/*     */       case "craft3":
/* 255 */         return (ItemStack)container.func_75138_a().get(3);
/*     */       case "craft4":
/* 257 */         return (ItemStack)container.func_75138_a().get(4);
/*     */       
/*     */       case "head":
/* 260 */         return (ItemStack)container.func_75138_a().get(5);
/*     */       case "chest":
/* 262 */         return (ItemStack)container.func_75138_a().get(6);
/*     */       case "leg":
/* 264 */         return (ItemStack)container.func_75138_a().get(7);
/*     */       case "feet":
/* 266 */         return (ItemStack)container.func_75138_a().get(8);
/*     */       
/*     */       case "mainhand":
/* 269 */         return entityPlayerSP.func_184614_ca();
/*     */       case "offhand":
/* 271 */         return entityPlayerSP.func_184592_cb();
/*     */       
/*     */       case "current":
/* 274 */         return ((EntityPlayer)entityPlayerSP).field_71071_by.func_70448_g();
/*     */       case "shield":
/* 276 */         return (ItemStack)container.func_75138_a().get(45);
/*     */     } 
/*     */     
/*     */     try {
/* 280 */       return (ItemStack)container.func_75138_a().get((int)Double.parseDouble(str));
/* 281 */     } catch (Exception exception) {
/* 282 */       return ItemStack.field_190927_a;
/*     */     } 
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   public ConcurrentHashMap<String, YamlConfiguration> h() {
/* 289 */     return this.i;
/*     */   }
/*     */   
/*     */   public ConcurrentHashMap<String, ItemStack> z() {
/* 293 */     return this.z;
/*     */   }
/*     */   
/*     */   public ConcurrentHashMap<String, String> v() {
/* 297 */     return this.w;
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\dh.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */